home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SGI Developer Toolbox 6.1
/
SGI Developer Toolbox 6.1 - Disc 4.iso
/
src
/
swtools
/
trubasic
/
rolldemos
/
chooser
/
scimenu.tru
< prev
next >
Wrap
Text File
|
1994-08-02
|
2KB
|
68 lines
external
! main menu loop for scientific graphics demos
module sci
DECLARE PUBLIC scipts(,),scitxt$()
sub sci_demos
call draw_sci
call waitup
do
call getclick_sci(op)
if op=1 then
chain "!cd ../demos/sci;../../basic/tru -i aboutsci.tru &",return
elseif op=2 then
chain "!cd ../demos/sci;../../basic/tru -i lsquare.tru &",return
elseif op=3 then
chain "!cd ../demos/sci;../../basic/tru -i meanfit.tru &",return
elseif op=4 then
chain "!cd ../demos/sci;../../basic/tru -i spline.tru &",return
elseif op=5 then
chain "!cd ../demos/sci;../../basic/tru -i vfunc.tru &",return
elseif op=0 then
exit sub
end if
if op<>0 and op<>-1 then
call expand(scipts(op,1),scipts(op,2),scipts(op,3),scipts(op,4))
draw textbox(scipts(op,1),scipts(op,2),scipts(op,3),scipts(op,4),scitxt$(op))
call waitup
pause 3
call unexpand(scipts(op,1),scipts(op,2),scipts(op,3),scipts(op,4))
draw textbox(scipts(op,1),scipts(op,2),scipts(op,3),scipts(op,4),scitxt$(op))
end if
if refresh(1)=1 then
call draw_sci
end if
loop
end sub
sub draw_sci
let u=ubound(scipts,1)
clear
for i=1 to u
draw scibox(i)
next i
box keep 0,1,0,1 in scibox$
end sub
picture scibox(op)
draw box(scipts(op,1),scipts(op,2),scipts(op,3),scipts(op,4),op)
draw textbox(scipts(op,1),scipts(op,2),scipts(op,3),scipts(op,4),scitxt$(op))
end picture
sub getclick_sci(op)
get mouse x,y,state
let op=-1
if state<>0 and x>=0 and x<=1 and y>=0 and y<=1 then
let u=ubound(scipts,1)
let op=0
for i=1 to u
if x>scipts(i,1) and x<scipts(i,2) and y>scipts(i,3) and y<scipts(i,4) then
let op=i
exit sub
end if
next i
end if
end sub
end module